#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
bool prime(long long x)
{
    if (x < 2) return false;
    for (long long i = 2;i < sqrt(x);i++)
    {
        if (x % i == 0) return false;
    }
    return true;
}
int main()
{
    int t = 0;
    cin >> t;
    string s = to_string(t);
    int n = s.size();
    for (int i = n - 2;i >= 0;i--)
    {
        s.push_back(s[i]);
    }
    long long x = stoll(s.c_str());
    if (prime(x))
    {
        cout << "prime" << endl;
    }
    else
    {
        cout << "noprime" << endl;
    }
    return 0;
}
